Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates how status values are handled across both the client and server to standardize on using "Ready" instead of "active". Key changes include:
- Updating the status conversion functions to remove lowercasing and explicit mapping for "active"/"Ready".
- Changing client calls (in eventService, Donors.jsx, and Dashboard.jsx) to use "Ready" consistently.
- Removing special-case handling for "active" in API routes and recalculating donor statistics based on detailed donor data.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/utils/statusConversion.js | Removed switch-case conversion logic and now returns raw backendStatus. |
| client/src/services/eventService.js | Eliminated mapping of status parameters and response status conversion. |
| client/src/components/donors/Donors.jsx | Updated condition checks from “active” to “Ready” for editing donor information. |
| client/src/components/Dashboard.jsx | Changed status parameter in the events fetch from “active” to “Ready”. |
| Server/src/routes/event.js | Removed special handling for 'active' status in query filtering. |
| Server/src/routes/donorList.js | Revised donor list query to include event donors and recalculated statistics accordingly. |
Files not reviewed (1)
- client/src/components/events/EventManagement.css: Language not supported
Comments suppressed due to low confidence (6)
Server/src/routes/event.js:116
- The mapping for 'active' status has been removed, which may affect filtering logic. Please verify that this removal is intentional and that filtering by status behaves as expected.
if (validStatuses.includes(status)) {
client/src/utils/statusConversion.js:10
- The previous conversion logic that mapped 'Ready' to a different format (lowercasing the value) has been removed. Please confirm that returning the raw backendStatus is intended and that all parts of the application correctly handle this change.
return backendStatus;
client/src/services/eventService.js:19
- The logic that converted the 'active' status to 'Ready' has been removed. Verify that the backend now expects status values in the new format and that client calls are updated accordingly.
Object.keys(params).forEach(key => {
client/src/components/donors/Donors.jsx:506
- The conditional check has been updated from 'active' to 'Ready'. Ensure that this change aligns with the new status standards across both client and server.
if (selectedEvent.status !== 'Ready') {
client/src/components/Dashboard.jsx:34
- The status filter in the dashboard fetch has been updated to 'Ready'. Confirm that all dependent components and logic are now operating under the assumption that events are identified by 'Ready' rather than 'active'.
const eventsResult = await getEvents({ status: 'Ready', limit: 10 });
Server/src/routes/donorList.js:642
- The query now includes event donors and calculates statistics based on donor details rather than pre-aggregated fields. Confirm that this new approach produces the expected results and is consistent with client-side assumptions.
const donorLists = await prisma.eventDonorList.findMany({
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.